//
//  MusicListTableViewCell.m
//  项目
//
//  Created by 张诗雨 on 15/1/4.
//  Copyright (c) 2015年 张诗雨. All rights reserved.
//

#import "MusicListTableViewCell.h"
#import "WebColor.h"
@implementation MusicListTableViewCell

- (void)dealloc
{
    [super dealloc];
    [_authorLable release];
    [_titleLable release];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.titleLable = [[UILabel alloc] init];
        self.titleLable.textColor = [WebColor whiteSmoke];
        self.titleLable.font = [UIFont boldSystemFontOfSize:17.0f];
        self.titleLable.textAlignment = NSTextAlignmentJustified;
        [self.contentView addSubview:self.titleLable];
        [_titleLable release];
        
        self.authorLable = [[UILabel alloc] init];
        self.authorLable.textColor = [WebColor lightGray];
        self.authorLable.font = [UIFont systemFontOfSize:15.0f];
        [self.contentView addSubview:self.authorLable];
        [_authorLable release];
        
        self.button = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.button setBackgroundImage:[UIImage imageNamed:@"xiazai.png"] forState:UIControlStateNormal];
        [self.contentView addSubview:self.button];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLable.frame = CGRectMake(10, 10, self.frame.size.width - 50, (self.frame.size.height - 20)/ 2);
    self.authorLable.frame = CGRectMake(10, (self.frame.size.height - 20) / 2 + 10, self.frame.size.width - 50, (self.frame.size.height - 20) / 2);
    self.button.frame = CGRectMake(self.frame.size.width - 40, self.frame.size.height / 2 - 15, 30, 30);
}
@end
